<template>
  <view>
      <div v-for="item in GoodsCommentList" :key="item.id">
          <commentItem  :commentItem="item" />
      </div>
  </view>
</template>

<script>
import commentItem from '../components/commentItem'
let goodsId;
export default {
  name: "index",
  components:{
    commentItem
  },
  data() {
    return {
      commentTotal:0,
      GoodsCommentList:[],
      goodsId:''
    }
  },
  onLoad(options){
    this.getGoodsCommentList(options.id)
  },
  methods: {
    getGoodsCommentList(goods_id) {
      const data = {
        goods_id
      }
      this.$http.getGoodsCommentList(data).then(res => {
        if (res.status === 200) {
          const {data,total} = res.data
          this.commentTotal = total
          this.GoodsCommentList = data
        }
      })
    },
  }
}
</script>

<style scoped>

</style>